package com.wm.bean;

import java.io.*;
import java.util.Date;
import java.util.List;

public class Orders implements Serializable {
	private static final long serialVersionUID = 3938860373226088110L;
	
	private long id;					//主键ID
	private long userId;				//用户ID
	private String linkMan;				//联系人
	private String phone;				//联系电话
	private String backPhone;			//备用电话
	private String address;				//地址
	private long scrId;					//写字楼ID
	private int valid;					//用户是否保存，0不保存1保存
	private Date addTime;				//添加时间
	private long resId;					//饭店ID
	private String resName;				//饭店名字
	private int state;					//状态，0下单1饭店接单2送出3交易成功,状态不为0用户不可删除
	private long totalPrice;			//总价格
	private long totalPrice2;			//总价格 get里没有下面那个计算的
	private int totalSum;				//总份数
	private String delivery;				//距离起送价还有多少
	private String memo;				//描述
	
	private List menuList;				//菜单列表
	private Scriptorium scriptorium;	//写字楼
	private Restaurant restaurant;		//饭店信息
	private int totalCopies;			//订单总份数
	private String totalPriceShow;		//订单总价格显示用

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public long getTotalPrice2() {
		return totalPrice2;
	}

	public void setTotalPrice2(long totalPrice2) {
		this.totalPrice2 = totalPrice2;
	}

	public int getTotalCopies() {
		return totalCopies;
	}

	public void setTotalCopies(int totalCopies) {
		this.totalCopies = totalCopies;
	}

	public String getTotalPriceShow() {
		return totalPriceShow;
	}

	public void setTotalPriceShow(String totalPriceShow) {
		this.totalPriceShow = totalPriceShow;
	}

	public Restaurant getRestaurant() {
		return restaurant;
	}

	public void setRestaurant(Restaurant restaurant) {
		this.restaurant = restaurant;
	}

	public String getDelivery() {
		return delivery;
	}

	public void setDelivery(String delivery) {
		this.delivery = delivery;
	}

	public int getTotalSum() {
		return totalSum;
	}

	public void setTotalSum(int totalSum) {
		this.totalSum = totalSum;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public String getLinkMan() {
		return linkMan;
	}

	public void setLinkMan(String linkMan) {
		this.linkMan = linkMan;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getBackPhone() {
		return backPhone;
	}

	public void setBackPhone(String backPhone) {
		this.backPhone = backPhone;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public long getScrId() {
		return scrId;
	}

	public void setScrId(long scrId) {
		this.scrId = scrId;
	}

	public int getValid() {
		return valid;
	}

	public void setValid(int valid) {
		this.valid = valid;
	}

	public Date getAddTime() {
		return addTime;
	}

	public void setAddTime(Date addTime) {
		this.addTime = addTime;
	}

	public long getResId() {
		return resId;
	}

	public void setResId(long resId) {
		this.resId = resId;
	}

	public String getResName() {
		return resName;
	}

	public void setResName(String resName) {
		this.resName = resName;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public long getTotalPrice() {
		long total = 0;
		for(int i=0;i<menuList.size();i++){
			OrderResMenu m = (OrderResMenu) menuList.get(i);
			total = m.getPrice()*m.getCopies();
		}
		totalPrice = total;
		return totalPrice;
	}

	public void setTotalPrice(long totalPrice) {
		this.totalPrice = totalPrice;
	}

	public List getMenuList() {
		return menuList;
	}

	public void setMenuList(List menuList) {
		this.menuList = menuList;
	}

	public Scriptorium getScriptorium() {
		return scriptorium;
	}

	public void setScriptorium(Scriptorium scriptorium) {
		this.scriptorium = scriptorium;
	}
}
